'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class userProfile extends Model {
    static associate(models) {
      // define association here
    }
  };
  userProfile.init({
    id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      autoIncrement: true,
      comment: '用户id',
      primaryKey: true,
    },
    use_id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: '用户id'
    },
    nickname: {
      type: Sequelize.STRING,
      allowNull: false,
      defaultValue: '',
      comment: '昵称'
    },
    realname: {
      type: Sequelize.STRING,
      allowNull: false,
      defaultValue: '',
      comment: '真实姓名'
    },
    gender: {
      type: Sequelize.STRING,
      allowNull: false,
      defaultValue: '',
      comment: '性别'
    },
    birthday: {
      type: Sequelize.DATE,
      allowNull: false,
      defaultValue: '1999-09-09',
      comment: '出生日期'
    },
    created_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'created_at',
      comment: '用户注册的时间'
    },
    updated_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'updated_at',
      comment: '用户更新登录的时间'
    }
  }, {
    sequelize,
    modelName: 'user-profile',
    tableName: 'user-profile'
  });
  return userProfile;
};